package demo4;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User:张熳
 * Date:2025-08-28
 * Time:21:41
 */
//实现多个接口

public class Duck extends Animal implements ISwimming,IRunning,IFly{
    public Duck(String name, int age) {
        super(name, age);
    }

    @Override
    public void eat() {
        System.out.println(this.name + "🦆正在吃虫子");
    }

    @Override
    public void fly() {
        System.out.println(this.name + "🦆正在天空飞~");
    }

    @Override
    public void run() {
        System.out.println(this.name + "🦆正在地上奔跑~");
    }

    @Override
    public void swim() {
        System.out.println(this.name + "🦆正在水里游泳~");
    }
}
